using System.Runtime.InteropServices.Marshalling;

namespace ConsoleApp3._0928;

public class Demo2
{
    public void Test1()
    {
        int n = 0;
        int[] a=new int[1001];
        for (int i = 1; i < 1000; i++)
        {
            if (i >= 1 && i < 10){
                a[n]=i;
                n++;
            }
            else if (i >= 10 && i < 100)
            {
                int b = i % 10;
                int c = i / 10;
                if (b*b+c*c == i)
                {
                    a[n]=b;
                    n++;
                }
            }
            else
            {
                int d=i % 10;
                int e = i / 100;
                int f = (i - e * 100) / 10;
                if (Math.Pow(d,3)+Math.Pow(f,3)+Math.Pow(e,3) == i)
                {
                    a[n] = i;
                    n++;
                }
            }
        }

        for (int i = 0; i < n; i++)
        {
            Console.WriteLine(a[i]);
        }
        
    }



    public void Test2()
    {
        Console.WriteLine(2);
        for (int i = 3; i <= 100; i+=2)
        {
            bool p = true;
            for (int j = 2; j <= Math.Pow(i, 0.5); j++)
            {
                if (i % j == 0)
                {
                    p=false;
                    break;
                }
            }
            if (p)
            {
                Console.WriteLine(i);
            }
        }
    }
}